// 项目列表信息
var proColumns = [{
  id: 'recNo',
  title: '项目类型',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recName',
  title: '项目名称',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recPrc',
  title: '优先级',
  width: 60,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recTime',
  title: '当前阶段',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'recText',
  title: '状态',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'utime',
  title: '项目当前进展',
  // width: 100,
  type: 'string',
  columnClass: 'text-left',
}, {
  id: 'guan',
  title: '关注',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'operation',
  title: '操作',
  type: 'string',
  width: 130,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-primary" onclick=""><i class="icon-eye-open"></i>  数据</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-warning" onclick="get(' + record.id + ');"><i class="icon-tag"></i>  关注</button>';
    return content;
  }
}];
var proOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目信息列表',
  datas: [{
    id: 1,
    recNo: '销售类型',
    recName: '项目名称测试数据',
    recPrc: '高',
    recTime: '立项阶段',
    recText: '运行中',
    utime: '项目当前进展测试数据',
    guan: '已关注'
  }, {
    id: 2,
    recNo: '销售类型',
    recName: '项目名称测试数据',
    recPrc: '高',
    recTime: '立项阶段',
    recText: '运行中',
    utime: '项目当前进展测试数据',
    guan: '未关注'
  }, ],
  columns: proColumns,
  gridContainer: 'proContainer',
  toolbarContainer: 'proToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var proGrid = $.fn.dlshouwen.grid.init(proOption);
$(function () {
  proGrid.load();
});


// 合同列表信息
var htglColumns = [{
  id: 'recNo',
  title: '合同编号',
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recName',
  title: '合同名称',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recPrc',
  title: '项目名称',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recTime',
  title: '合同金额',
  type: 'string',
  width: 100,
  columnClass: 'text-center',
}, {
  id: 'recText',
  title: '开票金额',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 's1',
  title: '剩余开票金额',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'utime',
  title: '已收款',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'guan',
  title: '未收款',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'operation',
  title: '操作',
  type: 'string',
  width: 130,
  columnClass: 'text-center',
  resolution: function (value, record, column, grid, dataNo, columnNo) {
    var content = '';
    content += '<button class="btn btn-xs btn-primary" onclick="checkDetail('+ record.id +');"><i class="icon-eye-open"></i>  明细</button>';
    content += '  ';
    content += '<button class="btn btn-xs btn-default" onclick="editHtgl(' + record.id + ');"><i class="icon-gear (alias)"></i>  管理</button>';
    return content;
  }
}];
var htglOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '项目信息列表',
  datas: [{
    id: 1,
    recNo: 'NJ20180102120031',
    recName: '测试数据',
    recPrc: '测试数据',
    recTime: '￥2222.00元',
    recText: '￥2222.00元',
    s1: '￥2222.00元',
    utime: '￥2222.00元',
    guan: '￥2222.00元'
  }, {
    id: 2,
    recNo: 'NJ20180102120031',
    recName: '测试数据',
    recPrc: '测试数据',
    recTime: '￥2222.00元',
    recText: '￥2222.00元',
    s1: '￥2222.00元',
    utime: '￥2222.00元',
    guan: '￥2222.00元'
  }, ],
  columns: htglColumns,
  gridContainer: 'htglContainer',
  toolbarContainer: 'htglToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var htglGrid = $.fn.dlshouwen.grid.init(htglOption);
$(function () {
  htglGrid.load();
});

// 合同管理-统计信息
var hlist1Columns = [{
  id: 'recNo',
  title: '合同编号',
  // width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recName',
  title: '合同金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recPrc',
  title: '开票总金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recTime',
  title: '剩余开票金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'y1',
  title: '已收款',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'y2',
  title: '未收款',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}];
var hlist1Option = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '统计信息列表',
  datas: [{
    id: 1,
    recNo: 'NJ20180102120031',
    recName: '￥2222.00元',
    recPrc: '￥2222.00元',
    recTime: '￥2222.00元',
    y1:'￥2222.00元',
    y2:'￥2222.00元',
  }, {
    id: 2,
    recNo: 'NJ20180102120031',
    recName: '￥2222.00元',
    recPrc: '￥2222.00元',
    recTime: '￥2222.00元',
    y1:'￥2222.00元',
    y2:'￥2222.00元',
  }, ],
  columns: hlist1Columns,
  gridContainer: 'hlist1Container',
  toolbarContainer: 'hlist1ToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var hlist1Grid = $.fn.dlshouwen.grid.init(hlist1Option);
$(function () {
  hlist1Grid.load();
});

// 开票信息
var plistColumns = [{
  id: 'recNo',
  title: '开票金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recName',
  title: '开票人',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recPrc',
  title: '开票时间',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recText',
  title: '税率',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
},{
  id: 'recTime',
  title: '发票内容',
  type: 'string',
  // width: 100,
  columnClass: 'text-left',
}, ];
var plistOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '开票信息列表',
  datas: [{
    id: 1,
    recNo: '￥2222.00元',
    recName: '张胜男',
    recPrc: '2018/01/02',
    recTime: '测试数据',
    recText: '80%',
  }, {
    id: 2,
    recNo: '￥2222.00元',
    recName: '李四',
    recPrc: '2018/01/02',
    recTime: '测试数据',
    recText: '80%',
  }, ],
  columns: plistColumns,
  gridContainer: 'plistContainer',
  toolbarContainer: 'plistToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var plistGrid = $.fn.dlshouwen.grid.init(plistOption);
$(function () {
  plistGrid.load();
});

// 回款记录
var recbleColumns = [{
  id: 'recNo',
  title: '经办人',
  width: 80,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recName',
  title: '回款金额',
  width: 150,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recPrc',
  title: '回款日期',
  width: 100,
  type: 'string',
  columnClass: 'text-center',
}, {
  id: 'recTime',
  title: '回款说明',
  type: 'string',
  columnClass: 'text-left',
},];
var recbleOption = {
  lang: 'zh-cn',
  ajaxLoad: false,
  // loadURL:'url',
  exportFileName: '回款信息列表',
  datas: [{
    id: 1,
    recNo: '张三',
    recName: '￥2222.00元',
    recPrc: '2018/01/02',
    recTime: '测试数据'
  }, {
    id: 2,
    recNo: '李四',
    recName: '￥2222.00元',
    recPrc: '2018/01/02',
    recTime: '测试数据'
  }, ],
  columns: recbleColumns,
  gridContainer: 'recbleContainer',
  toolbarContainer: 'recbleToolBarContainer',
  tools: '',
  pageSize: 10,
  pageSizeLimit: [10, 15, 20]
};
var recbleGrid = $.fn.dlshouwen.grid.init(recbleOption);
$(function () {
  recbleGrid.load();
});


function checkDetail(id){
  $('#myModal').modal("show");
}

function editHtgl(id){
  location.href = '../../opmt/htgl-1.html';
}